Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Preventing transliterator constant from being modified for concurrency concerns #184

Merged
merged 1 commit into from Dec 25, 2012

Conversation

stevenweber
Copy link
Contributor

During #initialize, DEFAULT_APPROXIMATIONS is added to approximations. The behavior of #add, though, will delete from the hash in order to stringify each value. When running a multithreaded application, the state of DEFAULT_APPROXIMATIONS will be in flux between threads leading to errors.

@tigrish
Copy link
Collaborator

tigrish commented Dec 24, 2012

Does this mean all transliteration hashes should have .freeze called on them or is this just for default approximations?

@stevenweber
Copy link
Contributor Author

DEFAULT_APPROXIMATIONS is the only hash that would cause these issues because it is class level and modified.

tigrish added a commit that referenced this pull request Dec 25, 2012
Preventing transliterator constant from being modified for concurrency concerns
@tigrish tigrish merged commit cb5a9d5 into ruby-i18n:master Dec 25, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants